package com.siam.package_rider.controller.rider;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.siam.package_common.entity.BasicResult;

import com.siam.package_rider.entity.TbRiderLevel;
import com.siam.package_rider.service.TbRiderLevelService;
import com.siam.package_rider.model.param.TbRiderLevelParam;

/**
 * ---------------------------
 * 骑手等级表 (TbRiderLevelController)         
 * ---------------------------
 * 作者：  高品
 * 时间：  2025-03-29 18:55:18
 * ---------------------------
 */
@RestController
@RequestMapping("/rest/rider/level")
public class TbRiderLevelController {

	@Autowired
	private TbRiderLevelService tbRiderLevelService;

	/**
	 * 保存骑手等级表
	 * @param param
	 * @return
	 */	
	@PostMapping(value="/insert")
	public BasicResult insert(@RequestBody TbRiderLevelParam param) {
		tbRiderLevelService.insert(param);
		return BasicResult.success();
	}

    /**
     * 删除骑手等级表
     * @param id
     * @return
     */
	@PostMapping(value="/delete")
	public BasicResult delete(@RequestParam Long id) {
		tbRiderLevelService.delete(id);
		return BasicResult.success();
	}

    /**
     * 批量删除骑手等级表
     * @param idList
     * @return
     */
	@PostMapping(value="/batchDelete")
	public BasicResult batchDelete(@RequestBody List<Long> idList) {
		tbRiderLevelService.batchDelete(idList);
		return BasicResult.success();
	}

	/**
	 * 修改骑手等级表
	 * @param param
	 * @return
	 */
	@PostMapping(value="/update")
	public BasicResult update(@RequestBody TbRiderLevelParam param) {
		tbRiderLevelService.update(param);
		return BasicResult.success();
	}

    /**
     * 基础分页查询
     * @param param
     * @return
     */    
	@PostMapping(value="/page")
	public BasicResult page(@RequestBody TbRiderLevelParam param) {
		return BasicResult.success(tbRiderLevelService.page(param));
	}
	
    /**
     * 根据主键查询
     * @param id
     * @return
     */ 	
	@PostMapping(value="/findById")
	public BasicResult findById(@RequestParam Long id) {
		return BasicResult.success(tbRiderLevelService.findById(id));
	}
}
